#include"Vector.h"

int main()
{
	const int NUM = 10000;
	double arr[NUM]{};
	double sum = 0;
	double steplen = 0;
	Vector vec;
	int N = 0;
	cout << "steplen:";
	cin >> steplen;
	cout << "how many steps:";
	cin >> N;
	srand(time(NULL));
	
	for (int i = 0; i < NUM; i++)
	{
		Vector ret;
		double randang;
		for (int j = 0; j < N; j++)
		{
			randang = rand();
			vec.setvector(steplen, randang, Vector::POL);
			ret = ret + vec;
		}
		double distance = ret.getdis();
		arr[i] = distance * distance;
		sum += arr[i];
		cout << "the " << i << " time:" << arr[i] << endl;
	}
	cout << "average:" << sum / NUM;
	return 0;
}
